package com.itboye.mengwu.data.presenter;

import java.util.List;
import java.util.Observer;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.object.BasePresenter;
import com.itboye.core.object.ResultEntity;
import com.itboye.mengwu.app.ui.main.MainPresenter;
import com.itboye.mengwu.data.interfaces.ICommentOnMe;
import com.itboye.mengwu.data.model.CommentOnMeModel;
import com.itboye.mengwu.data.model.MyCommentsModel;
import com.itboye.mengwu.data.repository.CommentOnMeRepository;

public class CommentOnMePresenter extends BasePresenter implements ICommentOnMe<MyCommentsModel> {

	
	
	public static final String CommentOnMe_success = MainPresenter.class
			.getName() + "_CommentOnMe_success";
	public static final String CommentOnMeFailEvent = MainPresenter.class
			.getName() + "_CommentOnMe_fail";
	
	public CommentOnMePresenter(Observer observer) {
		super(observer);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(MyCommentsModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(MyCommentsModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(MyCommentsModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void getInfo(MyCommentsModel model) {
		// TODO Auto-generated method stub
		ICommentOnMe<MyCommentsModel> icom = new CommentOnMeRepository(new ICompleteListener(){

			@Override
			public void success(ResultEntity result) {
			
				result.setEventTag(Tag_Success);
				result.setEventType(CommentOnMe_success);
				CommentOnMePresenter.this.setChanged();
				CommentOnMePresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				// TODO Auto-generated method stub
				result.setEventTag(Tag_Error);
				result.setEventType(CommentOnMeFailEvent);
				CommentOnMePresenter.this.setChanged();
				CommentOnMePresenter.this.notifyObservers(result);
			}
			
		});
	}

	@Override
	public List<MyCommentsModel> query(MyCommentsModel model) {
		// TODO Auto-generated method stub
		return null;
	}

}
